package gui.visu.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import controls.DataControl;


import gui.visu.components.DisplayDataOptionPanelUp;
import gui.visu.dialogs.JDialogColorWheel;

/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public class ListenerChooseSelectionColor implements ActionListener{
	
	private DataControl dataControl;
	private DisplayDataOptionPanelUp parent;

	public ListenerChooseSelectionColor(DataControl dataControl, DisplayDataOptionPanelUp parent){
		setDataControl(dataControl);
		setParent(parent);
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		JDialogColorWheel dial = new JDialogColorWheel(dataControl, "modify selection color", JDialogColorWheel.SELECTION);
		dial.setLocationRelativeTo(dataControl.getIhm());
		dial.setVisible(true);
		dial.init();
		dataControl.getIhm().setEnabled(false);
	}
	
	public DisplayDataOptionPanelUp getParent() {
		return parent;
	}

	public void setParent(DisplayDataOptionPanelUp parent) {
		this.parent = parent;
	}

	public DataControl getDataControl() {
		return dataControl;
	}

	public void setDataControl(DataControl dataControl) {
		this.dataControl = dataControl;
	}
}
